import axios from "axios";
import {
    interceptorsRequestConfig,
    interceptorsRequestConfigError,
    interceptorsResponseConfig,
    interceptorsResponseConfigError
} from "../config/interceptor/axios.ts";


const instance = axios.create({
    baseURL: import.meta.env.VITE_APP_BASE_API,
    timeout: 5000,
    headers: {
        "Content-Type": "application/json",
    }
});

instance.interceptors.request.use(interceptorsRequestConfig, interceptorsRequestConfigError);

instance.interceptors.response.use(interceptorsResponseConfig, interceptorsResponseConfigError);

export default instance;

